Fix event_pending() macro to match the assembly-language
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 17 Nov 2005 12:02:19 +0000 (13:02 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 17 Nov 2005 12:02:19 +0000 (13:02 +0100)
checks in entry.S. This will avoid a hard-to-debug loop
that we found ourselves in recently, involving
hypercall_preempt_check() spuriously returning TRUE, but
no event getting propagated to the guest (since mask != 0).

Signed-off-by: Keir Fraser <keir@xensource.com>
xen/include/xen/event.h

index e8a8bc2b5bc55f89604e67977b698c538e3c31dc..a8632eaf09e4e41b5fc5c25951db90163c1b3957 100644 (file)
@@ -60,7 +60,7 @@ extern void send_guest_pirq(struct domain *d, int pirq);
 
 /* Note: Bitwise operations result in fast code with no branches. */
 #define event_pending(v)                        \
-    ((v)->vcpu_info->evtchn_upcall_pending &    \
-     ~(v)->vcpu_info->evtchn_upcall_mask)
+    (!!(v)->vcpu_info->evtchn_upcall_pending &  \
+      !(v)->vcpu_info->evtchn_upcall_mask)
 
 #endif /* __XEN_EVENT_H__ */